package com.grape.basic2022.base;

/**
 * @Author pan_jin
 * @Description: $ 基础练习
 * @Date: 2022/8/22 17:59
 * @Version: 1.0.0
 * @Slogan: 梦想还是要有的万一实现了呢
 */
public class BaseLearn {
    public static void main(String[] args) {
//        String fruit="apple";
//        int apple=switch (fruit){
//            case "apple"-> 1;
//            case "origin","banala"->2;
//            default -> {
//                int code = fruit.hashCode();
//                yield code;
//            }
//        };
//        System.out.println("apple = " + apple);

//        int sum = 0;
//        int n = 1;
//        while (n > 0) {
//            sum = sum + n;
//            n++;
//        }
//        System.out.println(n); // -2147483648
//        System.out.println(sum);

        int sum = 0;
        int n = 0;
        while (n <= 100) {
            n++;
            sum = sum + n;
        }
        System.out.println(sum);
    }
}
